import { connect } from 'react-redux'
import {editTodo, deleteTodo, completeTodo} from '../redux/action'
import Content from '../components/Content'
import { getVisibleTodos } from '../selectors'
import { bindActionCreators } from 'redux'

const mapStateToProps = state => ({
    todos: getVisibleTodos(state)
})

const mapDispatchToProps = dispatch => ({
    actions: bindActionCreators({
        editTodo,
        deleteTodo,
        completeTodo
    }, dispatch)
})

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Content)